package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.nursing.domain.NursingProject;
import com.zzyl.nursing.service.INursingProjectService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: menghao
 * @version: 1.0
 * @Date: 2025/08/17 19:54
 * @Description:
 */
@RestController
@RequestMapping("/member/orders")
public class MemberOrdersController extends BaseController {
    @Autowired
    private INursingProjectService nursingProjectService;

    /**
     * C端分页查询护理项目列表
     * @param nursingProject
     * @return
     */
    @GetMapping("/project/page")
    @ApiOperation("C端分页查询护理项目列表")
    public TableDataInfo<List<NursingProject>> list(@ApiParam("护理项目查询条件") NursingProject nursingProject)
    {
        startPage();
        List<NursingProject> list = nursingProjectService.selectNursingProjectList(nursingProject);
        return getDataTable(list);
    }

    @GetMapping("/project/{id}")
    @ApiOperation("C端查询护理项目详细信息")
    public AjaxResult getInfo(@PathVariable Long id)
    {
        return success(nursingProjectService.selectNursingProjectById(id));
    }
}
